import { BrowserRouter as Router, Routes, Route, useNavigate } from 'react-router-dom';
import Login from './userview/account/login/Login';
import './App.css';
import Register from "./userview/account/register/Register";
import VideoPage from "./userview/home/video/video";

// 主页组件
function HomePage() {
  const navigate = useNavigate();

  return (
    <div className="App">
      <header className="App-header">
        <h1>欢迎来到短视频平台</h1>
        <p>发现精彩内容，记录美好生活</p>
        <button
          className="login-button"
          onClick={() => navigate('/login')}
        >
          立即登录
        </button>
      </header>
    </div>
  );
}

// 主路由配置
function App() {
  return (
    <Router>
      <Routes>
          <Route path="/" element={<HomePage />} />
          <Route path="/login" element={<Login />} />
          <Route path="/register" element={<Register />} />
          <Route path="/home" element={<VideoPage />} />
      </Routes>
    </Router>
  );
}

export default App;